package com.spring.Entity;

import javax.persistence.*;
import java.sql.Date;

/**
 * Created by Arabira on 2016/8/5.
 */
@Entity
@Table(name = "contract", schema = "contract")
public class ContractEntity {
    private String id;
    private String userId;
    private String contractId;
    private String contractName;
    private Date start;
    private Date remind;
    private Date deadline;
    private Integer times;
    private Integer paidNum;
    private Boolean warnOrNor;
    //    private String userName;
    private Date changetime;

    @Basic
    @Column(name = "contractId")
    public String getContractId() {
        return this.contractId;
    }

    public void setContractId(String contractId) {
        this.contractId = contractId;
    }


    @Id
    @Column(name = "id")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "userID")
    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "contractName")
    public String getContractName() {
        return contractName;
    }

    public void setContractName(String contractName) {
        this.contractName = contractName;
    }

    @Basic
    @Column(name = "start")
    public Date getStart() {
        return start;
    }

    public void setStart(Date start) {
        this.start = start;
    }

    @Basic
    @Column(name = "remind")
    public Date getRemind() {
        return remind;
    }

    public void setRemind(Date remind) {
        this.remind = remind;
    }

    @Basic
    @Column(name = "deadline")
    public Date getDeadline() {
        return deadline;
    }

    public void setDeadline(Date deadline) {
        this.deadline = deadline;
    }

    @Basic
    @Column(name = "times")
    public Integer getTimes() {
        return times;
    }

    public void setTimes(Integer times) {
        this.times = times;
    }

    @Basic
    @Column(name = "paidNum")
    public Integer getPaidNum() {
        return paidNum;
    }

    public void setPaidNum(Integer paidNum) {
        this.paidNum = paidNum;
    }

    @Basic
    @Column(name = "warnOrNor")
    public Boolean getWarnOrNor() {
        return warnOrNor;
    }

    public void setWarnOrNor(Boolean warnOrNor) {
        this.warnOrNor = warnOrNor;
    }

//    @Basic
//    @Column(name = "changetime")
//    public Date getChangetime() {
//        return changetime;
//    }
//
//    public void setChangetime(Date changetime) {
//        this.changetime = changetime;
//    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ContractEntity that = (ContractEntity) o;

        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (userId != null ? !userId.equals(that.userId) : that.userId != null) return false;
        if (contractName != null ? !contractName.equals(that.contractName) : that.contractName != null)
            return false;
        if (start != null ? !start.equals(that.start) : that.start != null) return false;
        if (remind != null ? !remind.equals(that.remind) : that.remind != null) return false;
        if (deadline != null ? !deadline.equals(that.deadline) : that.deadline != null) return false;
        if (times != null ? !times.equals(that.times) : that.times != null) return false;
        if (paidNum != null ? !paidNum.equals(that.paidNum) : that.paidNum != null) return false;
        if (warnOrNor != null ? !warnOrNor.equals(that.warnOrNor) : that.warnOrNor != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (userId != null ? userId.hashCode() : 0);
        result = 31 * result + (contractName != null ? contractName.hashCode() : 0);
        result = 31 * result + (start != null ? start.hashCode() : 0);
        result = 31 * result + (remind != null ? remind.hashCode() : 0);
        result = 31 * result + (deadline != null ? deadline.hashCode() : 0);
        result = 31 * result + (times != null ? times.hashCode() : 0);
        result = 31 * result + (paidNum != null ? paidNum.hashCode() : 0);
        result = 31 * result + (warnOrNor != null ? warnOrNor.hashCode() : 0);
        return result;
    }
}
